package com.qqtech.qquan.pub.model;

import java.util.ArrayList;
import java.util.List;

import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

import com.qqtech.core.common.util.StringUtil;
import com.qqtech.core.frame.model.BaseDomain;

@SuppressWarnings("serial")
public class PubUpgrade extends BaseDomain {
	/**
	 * 客户端svn版本
	 */
	private Integer svnAppVersion;
	/**
	 * 服务端svn版本
	 */
	private Integer svnServerVersion;

	// columns START
	/** 是否开启升级:1-是;2-否 **/
	private Integer isUpgrade;

	/** 升级后是否需要重启(针对应用内更新):1-是;2-否 **/
	private Integer isRestart;

	/** 是否静默更新:1-是;2-否 **/
	private java.lang.Integer isSilence;

	/** 是否需要在web后台对每次请求都判断是否要更新:1-是;2-否 **/
	private Integer isWebCheck;

	/** 是否只需内容版本的更新:1-是;2-否 **/
	private Integer isUpdContentOnly;
	/** 版本更新标题 */
	private java.lang.String title;
	/** 版本更新的内容，多个并列内容用逗号";"隔开 */
	private java.lang.String content;
	/** 原生安装升级到的版本号(各平台统一) */
	private java.lang.String nativeVersion;
	/** 至少原生版本号，少于此版本则必须安装原始包进行升级 */
	private java.lang.String leastNativeVersion;

	/** 修订号，每更新一次版本，数字要原则上加一 */
	private java.lang.Integer nativeBuild;
	/** android应用市场中原生包所在页面 **/
	private String androidMarketFile;
	/** android应用内差量要升级到的版本号 */
	private java.lang.String androidVersion;
	/** android差量更新的文件路径 */
	private java.lang.String androidUpdFile;

	/** ios应用市场中原生包所在页面 **/
	private String iosMarketFile;

	/** ios应用内差量要升级到的版本号 */
	private java.lang.String iosVersion;
	/** ios差量更新苹果的文件路径 */
	private java.lang.String iosUpdFile;
	private List<PubUpgradeContent> contentList;

	// columns END
	public PubUpgrade() {
	}

	public PubUpgrade(java.lang.Integer id) {
		this.id = id;
	}

	public String getAndroidMarketFile() {
		return androidMarketFile;
	}

	public java.lang.String getAndroidUpdFile() {
		return this.androidUpdFile;
	}

	public java.lang.String getAndroidVersion() {
		return this.androidVersion;
	}

	public java.lang.String getContent() {
		return this.content;
	}

	public List<PubUpgradeContent> getContentList() {
		return contentList;
	}

	public String getIosMarketFile() {
		return iosMarketFile;
	}

	public java.lang.String getIosUpdFile() {
		return this.iosUpdFile;
	}

	public java.lang.String getIosVersion() {
		return this.iosVersion;
	}

	public Integer getIsRestart() {
		return isRestart;
	}

	public java.lang.Integer getIsSilence() {
		return isSilence;
	}

	public Integer getIsUpdContentOnly() {
		return isUpdContentOnly;
	}

	public Integer getIsUpgrade() {
		return isUpgrade;
	}

	public Integer getIsWebCheck() {
		return isWebCheck;
	}

	public java.lang.String getLeastNativeVersion() {
		return leastNativeVersion;
	}

	public java.lang.Integer getNativeBuild() {
		return this.nativeBuild;
	}

	public java.lang.String getNativeVersion() {
		return this.nativeVersion;
	}

	public Integer getSvnAppVersion() {
		return svnAppVersion;
	}

	public Integer getSvnServerVersion() {
		return svnServerVersion;
	}

	public java.lang.String getTitle() {
		return this.title;
	}

	public void setAndroidMarketFile(String androidMarketFile) {
		this.androidMarketFile = androidMarketFile;
	}

	public void setAndroidUpdFile(java.lang.String androidUpdFile) {
		this.androidUpdFile = androidUpdFile;
	}

	public void setAndroidVersion(java.lang.String androidVersion) {
		this.androidVersion = androidVersion;
	}

	public void setContent(java.lang.String content) {
		if (StringUtil.isNotBlank(content)) {
			String[] contentArr = content.split(";");
			if (contentArr != null && contentArr.length > 0) {
				if (this.contentList == null) {
					this.contentList = new ArrayList<PubUpgradeContent>(10);
				}
				int index = 1;
				for (String string : contentArr) {
					if (StringUtil.isBlank(string)) {
						continue;
					}
					PubUpgradeContent c = new PubUpgradeContent();
					c.setId(index);
					c.setContent(string.trim());
					this.contentList.add(c);
					index++;
				}
			}
		}
		this.content = content;
	}

	public void setContentList(List<PubUpgradeContent> contentList) {
		this.contentList = contentList;
	}

	public void setIosMarketFile(String iosMarketFile) {
		this.iosMarketFile = iosMarketFile;
	}

	public void setIosUpdFile(java.lang.String iosUpdFile) {
		this.iosUpdFile = iosUpdFile;
	}

	public void setIosVersion(java.lang.String iosVersion) {
		this.iosVersion = iosVersion;
	}

	public void setIsRestart(Integer isRestart) {
		this.isRestart = isRestart;
	}

	public void setIsSilence(java.lang.Integer isSilence) {
		this.isSilence = isSilence;
	}

	public void setIsUpdContentOnly(Integer isUpdContentOnly) {
		this.isUpdContentOnly = isUpdContentOnly;
	}

	public void setIsUpgrade(Integer isUpgrade) {
		this.isUpgrade = isUpgrade;
	}

	public void setIsWebCheck(Integer isWebCheck) {
		this.isWebCheck = isWebCheck;
	}

	public void setLeastNativeVersion(java.lang.String leastNativeVersion) {
		this.leastNativeVersion = leastNativeVersion;
	}

	public void setNativeBuild(java.lang.Integer nativeBuild) {
		this.nativeBuild = nativeBuild;
	}

	public void setNativeVersion(java.lang.String nativeVersion) {
		this.nativeVersion = nativeVersion;
	}

	public void setSvnAppVersion(Integer svnAppVersion) {
		this.svnAppVersion = svnAppVersion;
	}

	public void setSvnServerVersion(Integer svnServerVersion) {
		this.svnServerVersion = svnServerVersion;
	}

	public void setTitle(java.lang.String title) {
		this.title = title;
	}

	@Override
	public String toString() {
		return ToStringBuilder.reflectionToString(this, ToStringStyle.MULTI_LINE_STYLE);
	}
}
